package ru.myrtle.jst.ast;

/**
 * An abstract class representing common aspects of all AST elements.
 */
public abstract class Element {

    private final Unit unit;
    private final int line;
    private final int column;

    protected Element(Unit unit, int line, int column) {
        this.unit = unit;
        this.line = line;
        this.column = column;
    }

    public Unit getUnit() {
        return unit;
    }

    public int getLine() {
        return line;
    }

    public int getColumn() {
        return column;
    }

    public abstract <ContextType> void accept(Visitor<ContextType> visitor, ContextType context);
}
